<template>
  <BasicDrawer v-bind="$attrs" @register="registerDrawer" destroyOnClose title="操作日志记录" :width="drawerWidth">
    <EmployeeLogIndex ref="employeeLogIndex"></EmployeeLogIndex>
  </BasicDrawer>
</template>
<script lang="ts" setup>
import { getCurrentInstance, ref, unref } from 'vue';
import EmployeeLogIndex from '../../employeeLog/index.vue';
import { BasicDrawer, useDrawerInner } from '@apps/antd-admin/src/components/drawer';
import { useAppInject } from '@apps/antd-admin/src/hooks/web/use-app-inject';
const { getIsMobile } = useAppInject();
const drawerWidth = ref('950px');
if (unref(getIsMobile)) {
  drawerWidth.value = '80%';
}
// 声明Emits
const emit = defineEmits(['success', 'register']);

const ctx: any = getCurrentInstance();
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async data => {
  let record = data.record;
  ctx.refs['employeeLogIndex'].setSearchInfoProps(record.employeeId);
});
</script>
